package com.openbravo.pos.printer.screen;

import com.openbravo.pos.forms.AppLocal;
import com.openbravo.pos.printer.DeviceDisplay;
import com.openbravo.pos.printer.DeviceDisplayBase;
import com.openbravo.pos.printer.DeviceDisplayImpl;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.UIDefaults;
import javax.swing.UIManager;

public class DeviceDisplayPanel extends JPanel
  implements DeviceDisplay, DeviceDisplayImpl
{
  private String m_sName;
  private DeviceDisplayBase m_displaylines;
  private JPanel jPanel1;
  private JLabel jline1;
  private JLabel jline2;

  public DeviceDisplayPanel()
  {
    this(1.0D);
  }

  public DeviceDisplayPanel(double paramDouble)
  {
    initComponents();
    this.m_sName = AppLocal.getIntString("Display.Screen");
    this.jline1.setFont(new Font("Monospaced", 1, (int)(16.0D * paramDouble)));
    this.jline2.setFont(new Font("Monospaced", 1, (int)(16.0D * paramDouble)));
    this.m_displaylines = new DeviceDisplayBase(this);
  }

  public String getDisplayName()
  {
    return this.m_sName;
  }

  public String getDisplayDescription()
  {
    return null;
  }

  public JComponent getDisplayComponent()
  {
    return this;
  }

  public void writeVisor(int paramInt, String paramString1, String paramString2)
  {
    this.m_displaylines.writeVisor(paramInt, paramString1, paramString2);
  }

  public void writeVisor(String paramString1, String paramString2)
  {
    this.m_displaylines.writeVisor(paramString1, paramString2);
  }

  public void clearVisor()
  {
    this.m_displaylines.clearVisor();
  }

  public void repaintLines()
  {
    this.jline1.setText(this.m_displaylines.getLine1());
    this.jline2.setText(this.m_displaylines.getLine2());
  }

  protected void paintComponent(Graphics paramGraphics)
  {
    paintBorder(paramGraphics);
    Graphics2D localGraphics2D = (Graphics2D)paramGraphics;
    Insets localInsets = getInsets();
    localGraphics2D.setPaint(new GradientPaint(getWidth() - localInsets.left - localInsets.right - 50, getHeight() - localInsets.top - localInsets.bottom - 50, getBackground(), getWidth() - localInsets.left - localInsets.right, getHeight() - localInsets.top - localInsets.bottom, new Color(15790320), true));
    localGraphics2D.fillRect(localInsets.left, localInsets.top, getWidth() - localInsets.left - localInsets.right, getHeight() - localInsets.top - localInsets.bottom);
  }

  private void initComponents()
  {
    this.jPanel1 = new JPanel();
    this.jline1 = new JLabel();
    this.jline2 = new JLabel();
    setBackground(UIManager.getDefaults().getColor("window"));
    setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0)));
    setLayout(new BorderLayout());
    this.jPanel1.setBorder(BorderFactory.createEmptyBorder(16, 16, 16, 16));
    this.jPanel1.setOpaque(false);
    this.jPanel1.setLayout(new GridBagLayout());
    this.jline1.setText("jline1");
    GridBagConstraints localGridBagConstraints = new GridBagConstraints();
    localGridBagConstraints.gridx = 0;
    localGridBagConstraints.gridy = 0;
    this.jPanel1.add(this.jline1, localGridBagConstraints);
    this.jline2.setText("jline2");
    localGridBagConstraints = new GridBagConstraints();
    localGridBagConstraints.gridx = 0;
    localGridBagConstraints.gridy = 1;
    this.jPanel1.add(this.jline2, localGridBagConstraints);
    add(this.jPanel1, "Center");
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.printer.screen.DeviceDisplayPanel
 * JD-Core Version:    0.6.0
 */